---
title: "SD-03 | UC-03: Avoid Front Obstacle"
---
sequenceDiagram
    participant CTR as :Controller
    participant MU as :MovementUnit
    participant LS as left:ObstacleSensor
    participant FS as front:ObstacleSensor

    CTR->>MU: stop()
    activate MU
    deactivate MU

    CTR->>LS: isObstacleDetected()
    LS-->>CTR: boolean

    CTR->>MU: turn(LEFT)
    activate MU
    deactivate MU

    CTR->>MU: moveForward()
    activate MU
    deactivate MU

    CTR->>MU: turn(RIGHT)
    activate MU
    deactivate MU

    CTR->>FS: isObstacleDetected()
    FS-->>CTR: boolean

    CTR->>MU: moveForward()
    activate MU
    deactivate MU
